package com.neomanager.admin.dao;

import java.util.ArrayList;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class AuthDao extends SqlMapClientDaoSupport 
{
	public Logger logger = Logger.getLogger(this.getClass());

	/**
	 *  아이디별 권한 메뉴 정보 목록
	 */
	public ArrayList<Map<String, Object>> selectMenuInfoById(String param) throws DataAccessException
	{
		logger.info("아이디별 권한 메뉴 정보 목록 DAO");
		@SuppressWarnings("unchecked")
		ArrayList<Map<String, Object>> mlist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("auth.selectMenuInfoById",param);
		return mlist;
	}
	
	/**
	 * 권한 등록
	 */
	public void insertAuthInfo(Map<String, Object> param) throws DataAccessException
	{
		logger.info("권한 등록 DAO");
		getSqlMapClientTemplate().insert("auth.insertAuthInfo", param);
        return;
	}
	
	/**
	 * 권한 삭제
	 */	
	public void deleteAuthInfoById(String param) throws DataAccessException {
		logger.info("권한 삭제 DAO");
		getSqlMapClientTemplate().update("auth.deleteAuthInfoById", param);
        return;
	}	
}

